package main

import (
	"fmt"

)

//定义一个结构体
type person struct {
	name string
	age int
	sex string
}


func main()  {
	var p1 person
	fmt.Println(p1)
	p1.name="王二狗"
	p1.age=30
	p1.sex="男"
	fmt.Println(p1)

	fmt.Println(p1.name,p1.age,p1.sex)
	fmt.Printf("%T,%p\n",p1, &p1)

	p2:=person{"李小花",28,"女"}
	fmt.Println(p2)


	p3:=person{age:21,name:"李小龙",sex:"女"}
	p4:=person{
		name:"rose",
		age:44,
		sex:"女",
	}
	fmt.Println(p3,p4)

	p5:=new(person)
	p5.name="老王"
	p5.age=50
	p5.sex="男"
	fmt.Println(p5)


}
